package xjtu.zd.server.staff.comment;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xjtu.zd.server.common.Result;

import javax.annotation.Resource;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/staff/comment")
public class CommentAPI {

    @Resource
    private CommentService commentService;

    @GetMapping("/search")
    public Result searchComment(QueryDto dto){
        log.info("访问了接口/staff/comment/search");
        Map<String,Object> page = commentService.getCommentReported(dto);
        return Result.success(page);
    }

    @RequestMapping("/handle")
    public Result handleComment(@RequestBody CommentDto comment){
        commentService.HandleComment(comment);
        return Result.success();
    }
}
